package net.waste.ics.procedures;

import net.waste.ics.IcsMod;

import net.minecraft.entity.Entity;

import java.util.Map;

public class IfFireToCreaturesProcedure {

	public static void executeProcedure(Map<String, Object> dependencies) {
		if (dependencies.get("entity") == null) {
			if (!dependencies.containsKey("entity"))
				IcsMod.LOGGER.warn("Failed to load dependency entity for procedure IfFireToCreatures!");
			return;
		}
		Entity entity = (Entity) dependencies.get("entity");
		{
			Entity _ent = entity;
			if (!_ent.world.isRemote && _ent.world.getServer() != null) {
				_ent.world.getServer().getCommandManager().handleCommand(_ent.getCommandSource().withFeedbackDisabled().withPermissionLevel(4),
						"/summon minecraft:potion ~ ~ ~ {CustomNameVisible:0b,Motion:[0.0,0.0,0.0],pickup:0,Potion:{id:\"minecraft:lingering_potion\",Count:1b,tag:{Potion:CBC,CustomPotionEffects:[{Id:7,Amplifier:1,Duration:200},{Id:2,Amplifier:1,Duration:200},{Id:17,Amplifier:1,Duration:200},{Id:18,Amplifier:1,Duration:200}]}}}");
			}
		}
	}
}
